{layout name="layout/login_head" /}
<!-- <header class="logo">
    <img src="__STATIC__/index/img/logo.png">
</header> -->

<content>

        <div class="phone tel">
            <img src="__STATIC__/index/img/tel.png"><input class="phonenumber" id="tel" type="tel" placeholder="输入手机号">
        </div>
        <input type="button" class="phone code" id="code" value="获取验证码">

        <p class="msg">未注册的手机号验证后自动创建优家舒适圈账户</p>

            <button id="zhuce" class="phone login" style="background: rgba(255,255,255,.3);">新用户注册</button>



</content>
<!--{load href="__STATIC__/layer/layer.js"}-->
<script src="__STATIC__/layer/layer.js"></script>
<script>
    // 取消提示的http地址显示
    window.alert = function(name) {
        var iframe = document.createElement("IFRAME");
        iframe.style.display = "none";
        iframe.setAttribute("src", 'data:text/plain,');
        document.documentElement.appendChild(iframe);
        window.frames[0].window.alert(name);
        iframe.parentNode.removeChild(iframe);
    }
    $(function(){

        $("#zhuce").click(function(){
          window.location.href="{:Url('index/login/zhuce')}";
        });
        $('#code').click(function(){

            var tel = $('#tel').val();



           if(tel == '' || tel.length != 11){
               alert("手机号格式不正确! ")
           }else {
               $.post('{:Url("index/login/get_code1")}',{tel:tel},function(data){
                   console.log(data);

               if(data == 1){
                       window.location.href="{:Url('index/login/code')}";
                       // alert('发送');
                   }else if(data == 2){
                       window.location.href="{:Url('index/login/code')}";
                   }else if(data == 3){
                       window.location.href="{:Url('index/login/code')}";
                   }else {
                       alert(data);
                   }

               });
           }

        });
    })
</script>